using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace YouYou
{
    public class ServerEntry : MonoBehaviour
    {
        public static SocketEvent SocketEvent { get; private set; }
        public static WebSocketEvent WebSocketEvent { get; private set; }

        public static SocketManager Socket { get; private set; }
        public static WebSocketManager WebSocket { get; private set; }

        private void Start()
        {
            SocketEvent = new SocketEvent();

            WebSocketEvent = new WebSocketEvent();

            Socket = new SocketManager();
            Socket.Init();

            WebSocket = new WebSocketManager();
            WebSocket.Init();

        }
        private void OnApplicationQuit()
        {
            Socket.Dispose();
            WebSocket.CloseWebSocket();
        }

        public static void Log(object message, params object[] args)
        {
#if DEBUG_LOG_NORMAL
            string value = string.Empty;
            if (args.Length == 0)
            {
                value = message.ToString();
            }
            else
            {
                value = string.Format(message.ToString(), args);
            }
            Debug.Log(string.Format("NetWorkLog=={0}", value));
#endif
        }


    }
}